/**
 *  *2010-4-10 上午11:41:30  add 
 */
package com.base.myproject.client.ui;

import com.base.myproject.client.system.BaseResource;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;

/**
 * 提示类
 * mode =1 info  2:help
 * @author Administrator
 *2010-4-10
 * javazgw@gmail.com
 */
public class StaticMessage extends LayoutContainer{

	/**
	 * mode =1 info  2:help
	 * @param text
	 * @param mode
	 */
	public StaticMessage(String text,int mode)
	{
		Image image = null;
		switch (mode) {
		case 1:
			image = new Image(BaseResource.INSTANCE.info_24());
			break;
		case 2:
			image = new Image(BaseResource.INSTANCE.help2_24());
			break;
		default:
			image = new Image(BaseResource.INSTANCE.info_24());
			break;
		}
		
		HTML html = new HTML("<a>"+text+"</a>");
		//this.setLayout(new RowLayout());
		 this.setLayout(new RowLayout(Orientation.VERTICAL));  
		this.add(image);
		this.add(html);
		setWordWrap(true);
		
		
	}
	  public void setWordWrap(boolean wrap) {
		    getElement().getStyle().setProperty("whiteSpace",
		        wrap ? "normal" : "nowrap");
		  }

}
